#include <linux/module.h>
#include <linux/init.h>

#include <linux/fs.h>
#include <linux/cdev.h>
#include <linux/mm.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/platform_device.h>

#include <asm/io.h>

MODULE_LICENSE("GPL");
MODULE_AUTHOR("zhanglong");

//----------------------------

struct class *zl_class;
struct class_device *test_cla_dev;

struct zl_device {
    struct device dev;
    dev_t no;
};

struct zl_device zl_dev = {
    .no = MKDEV(52,0),
};

int test_init(void)
{
    int ret = 0;

    zl_class = class_create(THIS_MODULE, "zl_class");
    test_cla_dev = device_create(zl_class, NULL, zl_dev.no, &(zl_dev.dev), "zldev_name");        
    return ret;
}

void test_exit(void)
{
    class_destroy(zl_class);
}

module_init(test_init);
module_exit(test_exit);

